package com.qyer.search.threading;/**
 * User: Z J Wu Date: 2016/01/04 Time: 17:04 Package: com.qyer.search.threading
 */

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.ForkJoinPool;

public class PhraseRecognizeThreadPoolHolder extends AbstractThreadPoolHolder {

  private static final Logger LOGGER = LoggerFactory.getLogger(PhraseRecognizeThreadPoolHolder.class);

  private static class InnerHolder {

    private static final PhraseRecognizeThreadPoolHolder INSTANCE = new PhraseRecognizeThreadPoolHolder();
  }

  private PhraseRecognizeThreadPoolHolder() {
    this.service = new ForkJoinPool();
    this.name = "PHRASE-RECOGNIZER";
    LOGGER.info("[{}] thread pool has been built.",this.name);
  }

  public static final PhraseRecognizeThreadPoolHolder getInstance() {
    return InnerHolder.INSTANCE;
  }

  public ForkJoinPool getForkService() {
    return (ForkJoinPool) getService();
  }

}
